# R1
def determine(item,element:list) ->int:
    """
    The function determine whether the item  exists in the element
    通过 in 方法判断，时间复杂度为O(1)
    :param item:
    :param element:list
    :return: int
    """
    if item in element:
        return 1
    else:
        return 0

print(determine(2,list(range(5))))

# R2
def determine1(item,element:list) ->int:
    """
    for 循环遍历，时间复杂度为O(n),随列表增大耗时增加
    :param item:
    :param element: list
    :return: int
    """
    for x in element:
        if x == item:
            return 1
    else:
        return 0
print(determine1(1,range(4)))

# 实现的很好，简洁明了。